<template>
  <div class="infinite-container">
    <empty v-show="showEmpty"></empty>
    <div class="labelList">
      <ul>
        <li v-for="(value, index) in personJudgeList" :key="index">
          <div class="detailTitle flex">
            <div class="user">
              <img src="../../assets/images/icon_mzfy_user.png" alt="">
              <span>{{value.patientName.slice(0,1)}}**</span>
            </div>
            <rate :size="18" :score="parseInt(value.score/2)" :readonly="true"></rate>
            <span class="flex_full timeText">{{value.evaluateTime}}</span>
          </div>
          <div class="detailLables">
            <ul class="flex wrap">
              <li v-for="(value1, index1) in personJudgeList[index].labelList" :key="index1">{{value1.title}}</li>
            </ul>
          </div>
          <div class="detailContent">
            {{value.content}}
          </div>
          <mu-divider inset style="margin:0 10px;width: auto"/>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
  import rate from '../../components/BsRate.vue'
  import empty from '../../components/empty.vue'
  import {commonAjaxJson, RESTFUL_API} from '../../api/api'
  export default {
    data () {
      return {
        personJudgeList: [],
        showEmpty: false
      }
    },
    components: {
      rate, empty
    },
    mounted () {
      this.queryJudgeList()
    },
    methods: {
      queryJudgeList () {
        let param = {
          templateIdArr: this.$route.query.templateIdArr,
          doctorCode: this.$route.query.doctorCode,
          pageNo: 1,
          pageSize: 100
        }
        commonAjaxJson(RESTFUL_API.queryPersonJudgeList, param, true).then(res => {
          if (res.data.code == 1 || res.data.code == 200) {
            this.personJudgeList = res.data.data
            if (res.data.data.length == 0) {
              this.showEmpty = true
            } else {
              this.showEmpty = false
            }
          } else {
            this.$store.commit('UPDATE_TOAST', {
              message: res.data.message
            });
          }
        })
      }
    }
  }
</script>

<style scoped lang="less">
  @import "../../common/css/flex.css";
  .labelList{
    background-color: white;
    .listUl>li{
      background-color: #E9F8F0;
      color: #7E7E7E;
      border-radius: 14px;
      height: 28px;
      line-height: 28px;
      width: 110px;
      text-align: center;
      margin: 5px;
      box-sizing: border-box;
    }
    .detailTitle{
      padding: 8px 10px;
      .timeText{
        text-align: right;
        color: #7E7E7E;
      }
      .user{
        margin-right: 10px;
        img {
          width: 20px;
          vertical-align: bottom;
        }
      }
    }
    .detailLables{
      margin: 0 10px;
      li {
        width: 100px;
        height: 26px;
        line-height: 26px;
        text-align: center;
        border-radius: 13px;
        background-color: #F2F2F2;
        color: #A5A5A5;
        margin: 0 5px 5px 0;
      }
    }
    .detailContent{
      padding: 10px;
    }
  }
</style>
